<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>跨域：第三方服务代理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link href="css/default.css" rel="stylesheet" type="text/css" />
<style type="text/css" >
*{margin:0px; padding:0px;}
.top {width:100%; height:130px;background:url(images/top_bg.gif) right top repeat-x;text-align:right;}
.top_bg2{background:url(images/top_right.gif) no-repeat right ;height: 104px;width: 100%; text-align:left;}
.top_bg2 img{padding:10px 0 0 18px;}
.top p a{color:#FFF; height:25px; text-decoration:underline;}
.top p{color:#FFF; height:25px;width:100%;background:#395782 url(images/navigation_bg.gif); line-height:25px}
a{blr:expression(this.onFocus=this.blur());outline:none}
</style>
<script type="text/javascript" src="api/jquery-1.6.js"></script>
<script type="text/javascript">
<!--  //-->
var weibo_url="http://weibo.palmcity.cn/publish2c/weiboQuery?u=1&p=2&c=1100&pageno=1&format=1&starttime=0&roadname=";
function sub_click(){
	var url = $('#url').val();
	var cityCode = $('#cityCode').val();
	var reqData = {url:url};//GET方式会造成url中参数混乱
	$.ajax({
		type: "POST",
		dataType: "text",
		url: "proxy3rdServer.action",
		data: reqData,
		cache: false,
		beforeSend: function(){
		},
		success: function(msg){
			$('#output').text(msg);
			windowWriter.document.write(msg);
			windowWriter.document.close();
			//windowWriter.location=url;
		},
		error: function(e){
			$('#output').text(e);
		}
	});
	return false;
}
var windowWriter = window.open("", "newwin", "height=500, width=500,toolbar=no,scrollbars=no"+",menubar=no");  
//this functions waits jQuery XML 
function xmlToString(xmlData) {
    var xmlString = undefined;
    if (window.ActiveXObject){
        xmlString = xmlData[0].xml;
    }
    if (xmlString === undefined)
    {
        var oSerializer = new XMLSerializer();
        xmlString = oSerializer.serializeToString(xmlData[0]);
    }
    return xmlString;
}

</script>
</head>
<body class="easyui-layout">
		<div  style="align-text:center;height:20px;" id="bgclock">输入目标url，返回文本内容，适用于跨域访问(暂不支持远程post请求，不支持二进制返回格式)</div>
		<div class="">
			<p>目标url:<input name="url" id="url" value="http://www.baidu.com" size="150" type="text"/></p>
		</div>
		<div style="color:#FFF;height:20px;" title="间隔"  id="west"></div>
		<div  style="height:20px;overflow:hidden" border="false">
			<input value="提交" size="50" type="button" onclick="sub_click();"/>
		</div>
		<div style="color:#FFF;height:20px;" title="间隔"  id="west"></div>
		<hr />
		<div id="tabs" class="easyui-tabs"  fit="true" border="false" >
			输出结果:
			<div title="输出结果" style="padding:20px;overflow:auto;" id="output">				
				
			</div>
		</div>


<script type="text/javascript">
/** 
 2.直接向第三方服务器请求，只支持返回js模式.
var url = "http://localhost:8080/lbs/fooServlet?" + "user=" + user + "&" + "password=" + password;
url = encodeURI(url);
//Submit to server with a trick
var js_obj = document.createElement( "script" );
js_obj.type = "text/javascript" ;
js_obj.setAttribute( "src" , url);
//Get response from server by appending it to document
document.body.appendChild(js_obj);
*/
</script>
</body>
</html>
